package main.java.utils;

import org.junit.Test;

import java.text.SimpleDateFormat;
import java.util.Date;

public class UploadUtils {
    public static String baseString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
    public static String randomString(int len){
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < len; i++) {
            int pos = (int)(Math.random()*baseString.length());
            char c = baseString.charAt(pos);
            str.append(c);
        }
        return str.toString();
    }

    public static String  getFormatTime(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        return sdf.format(new Date());
    }

    @Test
    public void test(){
        System.out.println(randomString(15));
    }
}
